public class HeterOrTest {
    public static int heterOrTest(int[] Array) {
        int once = 0;
        for (int i = 0; i < Array.length; i++) {
            once = once ^ Array[i];
        }
        return once;
    }
    //最大公因数，也称最大公约数、最大公因子，指两个或多个整数共有约数中最大的一个。
    public static int Max(int a,int b){
        if (a > b){
            return a;
        }else {
            return b;
        }
    }
    public static int Min(int a,int b){
        if (a < b){
            return a;
        }else {
            return b;
        }
    }
    public static int HCF(int a,int b){
        int tmp = Max(a, b) % Min(a, b);
        if (tmp == 0){
            return Min(a,b);
        }else {
            return tmp;
        }
    }
    public static void main(String[] args) {
        System.out.println(HCF(50,100));
    }

    public static void main1(String[] args) {
        int[] Array = {1,2,2,3,3,4,4};
        System.out.println(heterOrTest(Array));
    }
}
